<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
<script>
    const arr = [1, 2, 2, 3, 5]
    const del = arr.splice(2)
    console.log(del, arr)

    const arr1 = [1, 2, 2, 3, 5]
    const del1 = arr1.splice(2, 2)
    console.log(del1, arr1)

    const arr2 = [1, 2, 2, 3, 5]
    const del2 = arr2.splice(2, 2, 4, 8, 12)
    console.log(del2, arr2)
</script>
</body>

</html>
